package com.woniuxy.yuekeuser.dao;

import com.woniuxy.yuekeuser.model.CampsitePicture;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Freedom
 * @since 2020-11-03
 */
public interface CampsitePictureMapper extends BaseMapper<CampsitePicture> {
    @Select("SELECT\n" +
            "campsite_picture.campsite_picture_id,\n" +
            "campsite_picture.campsite_picture_address,\n" +
            "campsite_picture.campsite_picture_words,\n" +
            "campsite_picture.campsite_id\n" +
            "FROM\n" +
            "campsite_picture\n" +
            "WHERE\n" +
            "campsite_picture.campsite_id = #{campsiteId}")
    public List<CampsitePicture> getCampsitePictureByCampsiteId(Integer campsiteId);


    @Select("SELECT\n" +
            "campsite_picture.campsite_picture_id,\n" +
            "campsite_picture.campsite_picture_address,\n" +
            "campsite_picture.campsite_picture_words,\n" +
            "campsite_picture.campsite_id\n" +
            "FROM\n" +
            "campsite_picture")
    public List<CampsitePicture> getAllCampsitePicture();


    @Select("SELECT\n" +
            "campsite_picture.campsite_picture_address\n" +
            "FROM\n" +
            "campsite_picture\n" +
            "WHERE\n" +
            "campsite_picture.campsite_id = #{CampsiteId}")
    public List<String> getOneCampsitePictureAddressById(int CampsiteId);
}
